package com.jiazhong.example.project.bookstore.commons.bean;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@NoArgsConstructor
@Data
public class Book implements Serializable {
    @TableId
    private String id;
    private String categoryId;
    private String name;
    private String author;
    private String publisher;
    private Double price;
    private String imageName;
    private String description;
    @TableField(fill = FieldFill.INSERT)
    private String createTime;
    @TableField(fill = FieldFill.UPDATE)
    private String updateTime;
    @TableLogic(delval = "1", value = "0")
    private Integer isDeleted; // 逻辑删除字段 1删除 0未删除(默认)
    private Integer status;
    @TableField(exist = false)
    private Double discountRate;
    @TableField(exist = false)
    private Double discountPrice;
    @TableField(exist = false)
    private String discountId;
    @TableField(exist = false)
    private Boolean show = Boolean.FALSE; // 标记在购物车中是否存在 存在：true
    @TableField(exist = false)
    private Integer cartNum;  // 购物车中的数量
}
